import { lazy } from "react";
import {createBrowserRouter, Navigate} from "react-router-dom"
import Zhu from "../pages/Zhu/Zhu";

import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  UserOutlined,
} from '@ant-design/icons';

let Home=lazy(()=> import("../pages/Home/Home"));
let Login=lazy(()=> import("../pages/Login/Login"));
let List=lazy(()=> import("../pages/List/List"));
let Table=lazy(()=> import("../pages/Table/Table"));
let Shuju=lazy(()=> import("../pages/Shuju/Shuju"));
let Fen=lazy(()=> import("../pages/Fen/Fen"));
let Detail=lazy(()=> import("../pages/Detail/Detail"))
let Biao=lazy(()=> import("../pages/Biao/Biao"));

export const homeRoutes=[
    {
        path:"/zhu/home",
        element:<Home></Home>,
        title:"首页",
        icon:<DesktopOutlined></DesktopOutlined>
    },
    {
        path:"/zhu/shuju",
        element:<Shuju></Shuju>,
        title:"数据可视化",
        icon:<FileOutlined></FileOutlined>,
        children:[
            {
                path:"/zhu/shuju/fen",
                element:<Fen></Fen>,
                title:"分析页",
            }
        ]
    },
    {
        path:"/zhu/list",
        element:<List></List>,
        title:"列表页",
        icon:<TeamOutlined></TeamOutlined>,
        children:[
            {
                path:"/zhu/list/table",
                element:<Table></Table>,
                title:"查询表格",
            }
        ]
    },
    {
        path:"/zhu/detail",
        element:<Detail></Detail>,
        title:"详情页",
        icon:<UserOutlined></UserOutlined>
    },
    {
        path:"/zhu/biao",
        element:<Biao></Biao>,
        title:"表单页",
        icon:<PieChartOutlined></PieChartOutlined>
    }
]

let routes=createBrowserRouter([
    {
        path:"/",
        element:<Navigate to={"/zhu"}></Navigate>
    },
    {
        path:"/zhu",
        element:<Zhu></Zhu>,
        children:homeRoutes
    },
    {
        path:"/login",
        element:<Login></Login>
    },
])
export default routes